<?php 
//查询条件
$criteria=new CDbCriteria;
$criteria->compare('zm_id',$this->company['info']['zm_id']);
$criteria->compare('zp_status',2);
$criteria->compare('zp_state',2);
$criteria->limit = 6;

//最新产品
$criteria_new = $criteria;
$criteria_new->order = " inputtime DESC ";
$product_new = Product::model()->findAll($criteria_new);

//热销产品
$criteria_hot = $criteria;
$criteria_hot->order = " zp_sale_num DESC ";
$product_hot = Product::model()->findAll($criteria_hot);

//热门收藏
$criteria_fav = $criteria;
$criteria_fav->order = " zp_fav_num DESC ";
$product_fav = Product::model()->findAll($criteria_fav);

?>


<?php $this->beginContent('//layouts/space_main'); ?>
<div class="hr_12"></div>
<!--正文 start-->
<div class="w_970 o_a shop_index">
<div class="col_sub f_l">
	<!--店铺信息 start-->
	<div class="shop_info">
		<h2 class="shop_hd01">店铺信息</h2>
		<div class="bd bg_fff">
			<ul class="list">
				<li class="c_f"><span class="tit">联&nbsp;&nbsp;系&nbsp;&nbsp;人：</span><span class="other"><b><?php echo $this->company['link_man']?></b>（<?php echo $this->company['link_job']?>）</span></li>
				<li class="c_f"><span class="tit">联系电话：</span><span class="other"><?php echo $this->company['link_tel']?></span></li>
				<li class="c_f"><span class="tit">联系地址：</span><span class="other"><?php echo $this->company['link_address']?></span></li>
			</ul>
			<ul class="list no_border">
				<li class="c_f"><span class="tit">成交订单：</span><span class="other"><b class="c_f60"><?php echo $this->company['done_order']?></b>笔</span></li>
				<li class="c_f"><span class="tit">好&nbsp;&nbsp;评&nbsp;&nbsp;率：</span><span class="other"><?php echo $this->company['comment']?>%</span></li>
				<li class="c_f"><span class="tit">商家认证：</span><span class="other"><img src="/themes/basic/images/company.gif" alt="商家认证" /></span></li>
				<li class="c_f"><span class="tit">创店时间：</span><span class="other"><?php echo date('Y-m-d',$this->company['info']['inputtime'])?></span></li>
				<li class="c_f"><span class="tit">商品数量：</span><span class="other"><?php echo $this->company['product_count']?>款</span></li>
			</ul>
		</div>
	</div>
	<!--店铺信息 end-->
	<!--站内搜索 start-->
	<div class="site_search mt10">
		<h2 class="shop_hd01">站内搜索</h2>
		<form method="get" action="/product/list">
			<div class="bd bg_fff">
				<ul>
					<li class="price"><span class="tit">价格</span><input class="t_ipt" type="text" name="price_min" /><em class="mr5">-</em><input class="t_ipt" type="text" name="price_max" /></li>
					<li class="name"><span class="tit">名称</span><input class="t_ipt" type="text" name="name" /></li>
					<li><span class="tit">&nbsp;</span><input class="shop_bg btn_srh" type="submit" value="搜索" name="search" /></li>
				</ul>
			</div>
		</form>
	</div>
	<!--站内搜索 end-->
	<!--产品类别 start-->
	<div class="pro_category mt10">
		<h2 class="shop_hd01">产品类别</h2>
		<div class="bd bg_fff">
			<ul class="list">
				<?php if(!empty($this->company['cmp_cat'])){ foreach($this->company['cmp_cat'] as $val){?>
				<li class="item open">
					<p class="h"><span class="shop_bg ico_fold click2"></span>
						<?php echo CHtml::link(CHtml::encode($val['zpc_catname']),array('/product/list','id'=>$val['zpc_id']),array('class'=>'fw_b'))?>
					</p>
					<ul class="sub_list">
						<?php if(!empty($val['child'])){ foreach($val['child'] as $val2){?>
						<li><?php echo CHtml::link(CHtml::encode($val2['zpc_catname']),array('/product/list','id'=>$val2['zpc_id']),array('class'=>'fw_b'))?></li>
						<?php }}?>
					</ul>
				</li>
				<?php }}?>
			</ul>
		</div>
	</div>
	<!--产品类别 end-->
	<!--最新产品 start-->
	<div class="pro_new mt10">
		<h2 class="shop_hd01">最新产品</h2>
		<div class="bd bg_fff">
			<ul class="line_18">
				<?php if(!empty($product_new)){ foreach($product_new as $data){?>
				<li class="c_f">
					<div class="c_img c_img50 f_l">
						<?php echo CHtml::link(Tool::thumb($data->zp_pic,50,50,$data->zp_name),array('/product/detail','id'=>$data->zp_id))?>
					</div>
					<p class="title_pro">
						<?php echo CHtml::link(mb_substr($data->zp_name,0,22,'utf8'),array('/product/detail','id'=>$data->zp_id))?>
					</p>
					<p class="ff_yh c_f60 fw_b">&yen; <?php echo $data->zp_price?></p>
				</li>
				<?php }} ?>
			</ul>
		</div>
	</div>
	<!--最新产品 end-->
	<!--商品排行榜 start-->
	<div class="pro_rank mt10">
		<h2 class="shop_hd01">商品排行榜</h2>
		<div class="bd bg_fff">
			<div class="tab_hd2">
				<ul class="c_f">
					<li>热销商品排行</li>
					<li>热门收藏排行</li>
				</ul>
			</div>
			<div class="tab_cont2">
				<ul class="line_18">
					<?php if(!empty($product_hot)){ foreach($product_hot as $data){?>
					<li class="c_f">
						<div class="c_img c_img50 f_l">
							<?php echo CHtml::link(Tool::thumb($data->zp_pic,50,50,$data->zp_name),array('/product/detail','id'=>$data->zp_id))?>
						</div>
						<p class="title_pro">
							<?php echo CHtml::link(mb_substr($data->zp_name,0,22,'utf8'),array('/product/detail','id'=>$data->zp_id))?>
						</p>						
						<p class="ff_yh c_f60 fw_b">&yen; <?php echo $data->zp_price?></p>
						<p class="c_666">已售出：<?php echo $data->zp_sale_num?>笔</p>
					</li>
					<?php }}?>
				</ul>
			</div>
			<div class="tab_cont2">
				<ul class="line_18">
					<?php if(!empty($product_fav)){ foreach($product_fav as $data){?>
					<li class="c_f">
						<div class="c_img c_img50 f_l">
							<?php echo CHtml::link(Tool::thumb($data->zp_pic,50,50,$data->zp_name),array('/product/detail','id'=>$data->zp_id))?>
						</div>
						<p class="title_pro">
							<?php echo CHtml::link(mb_substr($data->zp_name,0,22,'utf8'),array('/product/detail','id'=>$data->zp_id))?>
						</p>						
						<p class="ff_yh c_f60 fw_b">&yen; <?php echo $data->zp_price?></p>
						<p class="c_666">收藏人数：<?php echo $data->zp_fav_num ?>人</p>
					</li>
					<?php }}?>
				</ul>
			</div>
		</div>
	</div>
	<!--商品排行榜 end-->
    <!-- 左则自定义编辑区star -->
    <div class="pro_rank mt10">
    	<?php echo $this->company['block_right']?>
    </div>
    <!-- 左则自定义编辑区end -->
</div>
<div class="col_main f_r">
	<?php echo $content; ?>
</div><!-- content -->
</div>
<!--正文 end-->
<?php $this->endContent(); ?>